package com.geektimes.jolokia;

import javax.management.*;
import java.lang.management.ManagementFactory;

public class JolokiaDemo {

    public static void main(String[] args) throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException, MBeanRegistrationException, InterruptedException {
        MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        //MBeanServer server = MBeanServerFactory.createMBeanServer("org.geektimes.jolokia");
        ObjectName objectName = new ObjectName("jolokia:org.geektimes.jolokia=Config");
        server.registerMBean(new Configuration(),objectName);

        System.out.println("start.....");
        Thread.sleep(1000000);
    }
}
